---
import ChangePasswordForm from '../../components/Setting/ChangePasswordForm';
import SettingSidebar from '../../components/Setting/SettingSidebar.astro';
import SettingLayout from '../../layouts/SettingLayout.astro';
---

<SettingLayout title='Change Password' description=''>
  <SettingSidebar pageUrl='change-password' name='Change Password'>
    <ChangePasswordForm client:load />
  </SettingSidebar>
</SettingLayout>

<script>
  import Cookies from 'js-cookie';
  import { TOKEN_COOKIE_NAME } from '../../lib/constants';
  const token = Cookies.get(TOKEN_COOKIE_NAME);

  if (!token) {
    window.location.href = '/';
  }
</script>
